﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cvk.FAQs;

namespace BatDongSan.Modules
{
    public partial class Uc_FAQMenuLeft : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {

                if (!IsPostBack)
                {
                    LoadData();
                }
            }
            catch { }
        }
        protected void LoadData()
        {
            try
            {
                rptFAQ.DataSource = FAQBll.claFAQCategory.GetAllList(Utility.strConnect, true);
                rptFAQ.DataBind();
            }
            catch { }

        }
        
        protected void rptFAQ_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            try
            {
                if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
                {
                    Cvk_FQACategory info = (Cvk_FQACategory)e.Item.DataItem;
                    HyperLink hplTitle = (HyperLink)e.Item.FindControl("hplTitle");
                    hplTitle.Text = info.Name;
                    hplTitle.NavigateUrl = "/FAQ.aspx?id=" + info.FQACategoryId.ToString();
                }
            }
            catch { }
        }
    }
}